<template>
	<section>
		<!--工具条-->
		<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
			<el-form :inline="true" :model="filters">
				<el-form-item>
					<el-input v-model="filters.operatorname" placeholder="运营商名称"></el-input>
				</el-form-item>
				<el-form-item>
					<el-button type="primary" v-on:click="getOperatorListPage">查询</el-button>
				</el-form-item>

			</el-form>
		</el-col>

		<!--列表-->
		<el-table :data="operators" highlight-current-row v-loading="listLoading"  border max-height="620" style="width: 100%;">
			<el-table-column type="index" width="80" label="编号">
			</el-table-column>
			<el-table-column prop="operatorname" label="运营商名称" width="180"  >
			</el-table-column>
			<el-table-column prop="code" label="运营商代码" width="180"  >
			</el-table-column>
			<el-table-column prop="createtime" label="创建时间" min-width="100"    >
			</el-table-column>
		</el-table>

		<el-pagination
				@current-change="handleCurrentChange"
				@size-change="handleSizeChange"
				layout="total,sizes,prev, pager, next"
				:total="total">
		</el-pagination>
	</section>
</template>

<script>
	import util from '../../common/js/util'
	//import NProgress from 'nprogress'
	import { getOperatorListPage } from '../../api/api';

	export default {
		data() {
			return {
				filters: {
                    operatorname: ''
				},
                operators: [],
                total: 0,
                start:0,
                pageSize:10,
				listLoading: false,
			}
		},
		methods: {
			//获取用户列表
            getOperatorListPage() {
                let para = {
                    start: this.start,
                    pageSize:this.pageSize,
                    operatorname: this.filters.operatorname,
                };
                this.listLoading = true;
                getOperatorListPage(para).then((datas) => {
                    this.listLoading = false;
                    let { message, code, data } = datas;
                    if (code !== "0") {
                        this.$message({
                            message: message,
                            type: 'error'
                        });
                    } else {
                        this.operators = data.result;
                        this.total = data.totalCount;
                    }
                });
			}

            ,handleCurrentChange:function(val){
                this.start = val - 1;
                this.getOperatorListPage();
            },
            handleSizeChange:function(val){
                this.pageSize = val;
                this.getOperatorListPage();
            }
		},
		mounted() {
			this.getOperatorListPage();
		}
	}

</script>

<style scoped>

</style>
